<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<body id="xiangqingPage">
<div id="xiangqingBox">
    <div class="page-title">
        <div class="page-title-con">
            <span class="pageshowtitle">详情</span>
            <div class="page-title-opt-list">
                <?php include "../public_flow/flow_show_optbut.php";?>
                <button class="layui-btn layui-btn-sm btn-light marginr5 opt">
                    操作<i class="layui-icon layui-icon-down layui-font-12"></i>
                </button>
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
    <div class="main-container">
        <div class="tongbox tongbox5">
            <div class="tuo">
                <div class="tit">协议名称</div>
                <div class="con" id="tong_name"></div>
            </div>
            <div class="tuo">
                <div class="tit">协议类型</div>
                <div class="con" id="tong_neihetype_name"></div>
            </div>
            <div class="tuo">
                <div class="tit">委托方</div>
                <div class="con" id="tong_dutyer"></div>
            </div>
            <div class="tuo">
                <div class="tit">所属单位</div>
                <div class="con" id="tong_chanid_name"></div>
            </div>
        </div>

        <div><?php include "../public_flow/flow_show_info.php";?></div>

        <div class="table-box tablenes">
            <div class="title">基本信息</div>
            <table class="layui-table">
                <tbody>

                <tr><td class="tt">协议类型</td><td id="neihetype_name" class="tv"></td><td class="tt">协议编号</td><td id="number" class="tv"></td></tr>
                <tr><td class="tt">协议名称</td><td id="name" class="tv"></td><td class="tt">协议年份</td><td id="year" class="tv"></td></tr>
                <tr><td class="tt">委托方</td><td id="dutyer" class="tv"></td><td class="tt">联系方式</td><td id="dutytel" class="tv"></td></tr>
                <tr><td class="tt"> 归属单位</td><td id="chanid_name" class="tv"></td><td class="tt">渠道来源</td><td id="canal" class="tv"></td></tr>
                <tr><td class="tt">合同状态</td><td id="state_name" colspan="3" class="tv"></td></tr>
                <tr><td class="tt">签订日期</td><td id="qiandt" class="tv"></td><td class="tt">经办人</td><td id="baner" class="tv"></td></tr>

                <tr><td class="tt">结算方式</td><td class="tv" id="settle" colspan="3"></td></tr>
                <tr><td class="tt">备注</td><td class="tv" id="explain" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>

        <div><?php include "../public/upinfo_show.php";?></div>

        <div><?php include "../public_flow/flow_show_flowrelas.php";?></div>

        <div class="table-box tablenes">
            <script type="text/html" id="toolbarDemo"><span>费用设置</span><span id="kouhelpss" style="cursor: pointer;font-size: 18px"><i class="layui-icon layui-icon-help"></i></span></script>
            <div class="tableShow">
                <table id="datalist" lay-filter="datalist"></table>
            </div>
        </div>

        <div><?php include '../public_flow/flow_show_shenlog.php'?></div>
        <div><?php include '../public_flow/flow_show_talk.php'?></div>
        <div><?php include '../public/opt_browse.php'?></div>
    </div>
</div>
<script>
    var param_id = getQueryVariable('id') || 0;

    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;

        facade.ajax({url: ask_contract_nei_show, data:{id: param_id}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data.data;


                $("#tong_name").text(data.name);
                $("#tong_neihetype_name").text(data.neihetype_name);
                $("#tong_dutyer").text(data.dutyer);
                $("#tong_chanid_name").text(data.chanid_name);


                $("#neihetype_name").text(data.neihetype_name);
                $("#number").text(data.number);
                $("#name").text(data.name);
                $("#year").text(data.year);
                $("#dutyer").text(data.dutyer);
                $("#dutytel").text(data.dutytel);
                $("#chanid_name").text(data.chanid_name);
                $("#canal").text(data.canal);
                $("#state_name").text(data.state_name);
                $("#qiandt").text(data.qiandt);
                $("#baner").text(data.baner);
                $("#settle").text(data.settle);
                $("#explain").text(data.explain);



                var mytableList = table.render({
                    elem: "#datalist",data:res.data.list, toolbar: '#toolbarDemo', page: false
                    ,limit:TabInitShow.limit,soulSort: TabInitShow.soulSort,method: TabInitShow.method, overflow: TabInitShow.overflow
                    ,defaultToolbar: TabInitShow.defaultToolbar,filter: TabInitShow.filter ,text: TabInitShow.text
                    ,request: TabInitShow.request,response: TabInitShow.response,contextmenu:get_table_contextmenu(soulTable)
                    , cols: [[
                        {type:'numbers',title:'序号',fixed:'left'}
                        ,{field: 'feiname_name', title: '费用项'}
                        ,{field: 'feitype_name', title: '计算方式'}
                        ,{field: 'feival', title: '计算值'}
                        ,{field: 'startdt', title: '开始计算月份'}
                        ,{field: 'enddt', title: '结束计算月份'}
                        ,{field: 'explain', title: '备注'}
                    ]]
                    , done: function (res) {
                        soulTable.render(this);

                        var curTipIndex = '';
                        $("#kouhelpss").on("mouseenter", function () {
                            var content = '<div style="padding: 5px; font-size: 12px; color: #FFFFFF;">' +
                                '<div>·按固定金额：填写的【计算值】将直接作为该费用项的应收取值</div>'+
                                '<div>·按月固定金额：填写的【计算值】将每月进行累加(需填写开始和结束月份)</div>'+
                                '<div>·按合同金额比例：填写的【计算值】将作为计算比例，与施工合同中的【合同金额】相乘得出应收（合同金额包含补充合同）</div>'+
                                '<div>·按合同结算金额比例：填写的【计算值】将作为计算比例，与施工合同结算的【实际结算金额】（合计）相乘得出应收（最终结算优先，如无最终结算，则依据进度结算）</div>'+
                                '<div>·按工程收入比例：填写的【计算值】将作为计算比例，与项目收款中款项类型为【工程回款】及其子项的【到账金额】（合计）相乘得出应收</div>'+
                                '<div>·按开票金额比例：填写的【计算值】将作为计算比例，与项目开票中的的【价税合计】（合计）相乘得出应收</div>'+
                                "</div>";
                            curTipIndex = layer.tips(content,this, {time: -1, maxWidth: 600, tips: [3, "#2272eb"],});
                        }).on("mouseleave", function () {
                            layer.close(curTipIndex);
                        });
                    }
                });

                public_flow_show_display(res.data.billinfo);
                public_upload_show_file('upload_files', res.data.files);
                render_from();
            }
        });

        public_get_readsandlog('contract_nei', param_id);
    });



</script>
</body>
</html>




